*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,'Microsoft YaHei',sans-serif;color:#1f2937;background:#f5f7fa}

.shell{display:flex;min-height:100vh}
.sidebar{width:260px;background:#ffffff;border-right:1px solid #e6eaef;padding:16px;display:flex;flex-direction:column;gap:12px}
.brand{font-weight:700;font-size:18px;margin-bottom:4px}
.session-list{flex:1;overflow:auto;border-top:1px solid #eef1f6;padding-top:10px}
.session-item{padding:10px;border-radius:10px;margin-bottom:8px;background:#fff;border:1px solid #e6eaef;cursor:pointer}
.session-item.active{border-color:#2f6f7e;box-shadow:0 0 0 2px rgba(47,111,126,.12)}

.workspace{flex:1;display:flex;flex-direction:column}
.topbar{height:54px;background:#2f6f7e;color:#eaf3f6;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid #254f59}
.topbar .title{font-size:16px;font-weight:600}

.panel{max-width:980px;margin:18px auto;background:#fff;border:1px solid #e6eaef;border-radius:10px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.panel-header{background:#f7fafc;border-bottom:1px solid #eef1f6;padding:12px 16px;font-weight:600}
.panel-body{padding:16px;display:flex;flex-direction:column;gap:16px}
.panel-footer{border-top:1px solid #eef1f6;padding:12px 16px;display:flex;gap:10px;align-items:center;justify-content:flex-end;background:#fff}

.field{display:flex;gap:14px;align-items:flex-start}
.label{width:110px;color:#4b5563;line-height:36px}
.control{flex:1}
.input{width:100%;height:36px;border:1px solid #d5dbe3;border-radius:8px;padding:8px 10px;outline:none;background:#fff}
.input:focus{border-color:#2f6f7e;box-shadow:0 0 0 2px rgba(47,111,126,.12)}
.textarea{width:100%;height:100px;border:1px solid #d5dbe3;border-radius:8px;padding:10px;resize:vertical;outline:none;background:#fff}
.textarea:focus{border-color:#2f6f7e;box-shadow:0 0 0 2px rgba(47,111,126,.12)}

.fieldset{border:1px solid #eef1f6;border-radius:8px;background:#fff}
.fieldset-title{font-size:14px;color:#6b7280;border-bottom:1px solid #eef1f6;background:#fafcfe;padding:8px 10px;border-top-left-radius:8px;border-top-right-radius:8px}

.messages{max-height:48vh;min-height:180px;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.msg{padding:12px 14px;border:1px solid #e6eaef;border-radius:12px;line-height:1.6;white-space:pre-wrap;word-break:break-word;background:#fff}
.msg.user{background:#f6f9fb}
.msg.assistant{background:#ffffff}
.msg.assistant.streaming{border-style:dashed}

.btn{height:36px;padding:0 16px;border-radius:8px;border:1px solid transparent;font-weight:600;cursor:pointer}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn-primary{background:#2f6f7e;color:#fff;border-color:#2a6270}
.btn-primary:hover{filter:brightness(1.05)}
.btn-secondary{background:#eef3f6;color:#334155;border-color:#d7dee5}
.btn-secondary:hover{background:#e6edf3}
.btn-ghost{background:#fff;border-color:#d7dee5;color:#475569}
.btn-ghost:hover{background:#f7fafc}

.wide{width:100%}